package com.akuhome.resource.enums;

import com.akuhome.resource.enums.mapper.CodeBasedEnum;
import com.akuhome.resource.util.CodeEnumUtil;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

public enum MessageStatus implements CodeBasedEnum {
    IN_SEND(1),SUCCESS(2),FAIL(3);

    private final Integer value;
    MessageStatus(Integer v){
        this.value = v;
    }
    @JsonValue
    public Integer getValue() {
        return value;
    }
    @JsonCreator
    public static MessageStatus valueOf(Integer value){
        return CodeEnumUtil.codeOf(MessageStatus.class,value);
    }

    @Override
    public Integer getCode() {
        return getValue();
    }
}
